<?php

class UserModel extends Model {

	public $table = '360_user';

	public function UserList(){
		$Count = $this->count();
		$PageObj = new Page($Count,2);
		$PageStr = $PageObj->show_b();
		$Limit = $PageObj->limit();
		$Sql = "SELECT user.uid,account,reg_time,login_time,ip FROM 360_user AS user JOIN 
		360_user_login_record AS user_login ON user.uid = user_login.uid GROUP BY account ORDER BY login_time DESC LIMIT {$Limit}";
		$UserList = $this->query($Sql);
		return array('User'=>$UserList,'Page'=>$PageStr);
	}
	public function UserCount(){
		return $this->field(" count(*) AS c ")->order(" uid ASC ")->select();
	}
}

?>